package 工厂方法模式.ImageReaderFactory;

//图片读取器工厂抽象类
public abstract class ImageReaderFactory {
    public abstract ImageReader  getReader();
}

//Gif图片读取器工厂类
class GifReaderFactory extends ImageReaderFactory{
    public ImageReader getReader() {
        return new GifReader();
    }
}

//JPG图片读取器工厂类
class JpgReaderFactory extends ImageReaderFactory{
    public ImageReader getReader() {
        return new JpgReader();
    }
}

//BMP图片读取器工厂类
class BmpReaderFactory extends ImageReaderFactory{
    public ImageReader getReader() {
        return new BmpReader();
    }
}
